import 'package:flutter/material.dart';

class SplashScreen extends StatefulWidget {
  const SplashScreen({super.key});

  @override
  _SplashScreenState createState() => _SplashScreenState();
}

class _SplashScreenState extends State<SplashScreen> {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      child:  ConstrainedBox(
        constraints: BoxConstraints.expand(),
        child: new Image.asset(
          "images/met_decelerate.gif",
          fit: BoxFit.fitWidth,
        ),
      ),
    );
  }
  @override
  void initState() {
    super.initState();
    countDown();
  }
  void countDown(){
    var duration = const Duration(seconds: 2);
    Future.delayed(duration, _indexPage);
  }
  void _indexPage(){
    Navigator.of(context).pushReplacementNamed('/IndexPage');
  }
}

